<template>
		<view class="img-box" :style="{height:statuHeight+'px'}">
			<image src="/static/login/backg.jpg" class="img"></image>
			<view class="logo-img-box">
				<image src="/static/login/logo.png" class="logo-img"  mode="aspectFill"></image>
			</view>
			<view class="btn">
				<view class="btn-register" @click="clickRegister">注册嗨番</view>
				<view class="btn-login" @click="clickLogin">登录</view>
			</view>
			<view class="footer">已经有帐户了？</view>
		</view>
</template>

<script>
	export default {
		data() {
			return {
				statuHeight: uni.getSystemInfoSync().screenHeight,
			}
		},
		onReady() {
			const token = uni.getStorageSync('authorization')
			if (token) {
				uni.switchTab({
					url: '/pages/home/index'
				})
			}
		},
		onShow() {
			
		},
		methods:{
			// 跳注册
			clickRegister() {
				uni.navigateTo({
				    url: '/pages/login/register'
				})
			},
			// 跳转登录
			clickLogin() {
				uni.navigateTo({
				    url: '/pages/login/login'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.img-box{
		width: 100%;
		position: relative;
		
		.img{
			width: 100%;
			height: 100%;
			object-fit:fill;
		}
		.logo-img-box{
			width: 141rpx;
			height: 141rpx;
			position: absolute;
			top: 15%;
			right: 0;
			left: 0;
			margin: auto;
			.logo-img{
				width: 100%;
				height: 100%;
			}
		}
		.btn{
			position: absolute;
			top: 0;
			right: 0;
			bottom: 0;
			left: 0;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			.btn-register{
				width: 545rpx;
				height: 90rpx;
				background: rgba(238,238,238,0.5);
				border-radius: 50rpx;
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
				line-height: 90rpx;
				text-align: center;
				margin-bottom: 39rpx;
			}
			.btn-login{
				width: 538rpx;
				height: 90rpx;
				background: rgba(62, 84, 156, 0);
				border: 1rpx solid #FFFFFF;
				line-height: 90rpx;
				text-align: center;
				border-radius: 50rpx;
				color: #FFFFFF;
			}
		}
		.footer{
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: rgba(238,238,238,0.6);
			position: absolute;
			right: 0;
			bottom: 66rpx;
			left: 0;
			text-align: center;
		}
	}
</style>
